// 10. 写一个函数readInt(Number nb)功能是读出整数，
// 如输入123期望的输出是"一百二十三";


function readInt(number) {
    const nums = ['一', '二', '三', '四', '五', '六', '七', '八', '九']
    const d = ['', '十', '百', '千', '万', '十万', '百万', '千万', '亿']

    let strNum = number.toString()
    strNum = strNum.split('')

    let res = ''
    let length = strNum.length
    strNum.forEach((item, index) => {
        if (item > 0) {
            res += nums[Number(item) - 1] + d[length - 1]
        } else {
            if (res[res.length - 1] !== '零') {
                res += '零'
            }
        }
        length--
    });

    return res

}
console.log(readInt(10041));


const person = {
    age: 11,
    name: '李兵'
}
Object.prototype.sex = '男'


for (const key in person) {
    if (Object.hasOwnProperty.call(person, key)) {
        const element = person[key];
        console.log(element);
    }
}